<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="https://unpkg.com/vue"></script>
    <script>
    window.onload=function(){
                var app4=new Vue({
                    el:'#app',

                    methods:{
                      addpeople:function(){
                          this.peoples.push({name:'zzz',age:'11'})
                      }

                    },


                    data:{
                        message:'hello vue.js!',
                        peoples:[
        {name:"zzh",age:18},
        {name:"zhazhihua",age:16}
                        ]
                    }
                })
            }
       </script>
</head>
<body>
<div id="app">

    <p>{{message}}</p>
    <button v-on:click="addpeople">增加</button>

    <table border="1">
        <tr><th>名字</th><th>年龄</th></tr>
        <tr v-for="people in peoples">
            <td>{{people.name}}</td>
            <td>{{people.age}}</td>
        </table>
    </div>

</body>
</html>